package com.ssy.lingxi.order.repository;

import com.ssy.lingxi.order.entity.PlatformPaymentDO;
import com.ssy.lingxi.order.entity.PlatformPaymentTypeDO;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 平台后台 - 会员支付策略 - 关联的支付方式Jpa仓库
 * @author 万宁
 * @version 2.0.0
 * @date 2021-08-11
 */
@Repository
public interface PlatformPaymentTypeRepository extends JpaRepository<PlatformPaymentTypeDO, Long>, JpaSpecificationExecutor<PlatformPaymentTypeDO>, QuerydslPredicateExecutor<PlatformPaymentTypeDO> {
    List<PlatformPaymentTypeDO> findByPayment(PlatformPaymentDO platformPayment, Sort sort);

    @Transactional
    void deleteByPayment(PlatformPaymentDO platformPayment);
}
